<?php

    require_once('adodb5/adodb.inc.php');
    require_once('adodb5/adodb-exceptions.inc.php');

    Class MyConnection
    {
        static $db;

        static function connect()
        {
            $db_driver    = 'postgres';
            $db_servidor  = 'localhost';
            $db_usuario   = 'postgres';
            $db_password  = 'postgres';
            $db_database  = 'postgres';

            //$db_driver    = 'postgres';
            //$db_servidor  = 'iic2412.ing.puc.cl';
            //$db_usuario   = 'grupo6';
            //$db_password  = 'G6.Bda10';
            //$db_database  = 'grupo6';

            self::$db = ADONewConnection($db_driver);
            self::$db->Connect($db_servidor, $db_usuario, $db_password, $db_database);
        }

        static function disconnect()
        {
            self::$db->Close();
        }
    }


    MyConnection::connect();
    $db = MyConnection::$db;


?>
